/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ro.futurefeed.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

/**
 *
 * @author Georgian
 */
public class DateUtil {
    private static final String FORMAT = "yyyy-MM-dd HH:mm";
    private static final SimpleDateFormat SDFGMT = new SimpleDateFormat(FORMAT);
    private static final SimpleDateFormat SDF = new SimpleDateFormat(FORMAT);
    
    static {
        SDFGMT.setTimeZone(TimeZone.getTimeZone("GMT"));
    }
    
    public static String getDateAtGMTString(Date date){
        return SDFGMT.format(date);
    }
    
    public static String getDateAtString(Date date){
        if(date == null){
            return null;
        }
        return SDF.format(date);
    }
    
    public static String getCurrentDateAtGMTString(){
        return SDFGMT.format(new Date());
    }
}
